package com.wardrobe.dao.booking;

import com.wardrobe.domain.booking.BookingBean;
import com.wardrobe.domain.booking.BookingFromBean;
import com.wardrobe.domain.booking.BookingShowBean;
import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.mapper.master.booking.BookingMasterMapper;
import com.wardrobe.mapper.slave.booking.BookingSlaveMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/16.
 */
@Service
public class BookingDao {
    @Autowired
    private BookingMasterMapper bookingMasterMapper;
    @Autowired
    private BookingSlaveMapper bookingSlaveMapper;

    public int insertBooking(BookingBean bookingBean){
        return bookingMasterMapper.insertBooking(bookingBean);
    }

    public int updateBooking(BackEndFromBean backEndFromBean){
        return bookingMasterMapper.updateBooking(backEndFromBean);
    }

    public List<BookingShowBean> selectBookingList(BookingFromBean fromBean){
        return bookingSlaveMapper.selectBookingList(fromBean);
    }

    public long countBooking(BookingFromBean fromBean){
        return bookingSlaveMapper.countBooking(fromBean);
    }

    public BookingShowBean selectBookingById(long id){
        return bookingSlaveMapper.selectBookingById(id);
    }

    public List<BookingShowBean> selectApiBookingList(){
        return bookingSlaveMapper.selectApiBookingList();
    }

    public List<BookingShowBean> selectBookingByShopId(long shopId){
        return bookingSlaveMapper.selectBookingByShopId(shopId);
    }
}
